package config

import (
	"fmt"

	"github.com/spf13/viper"
)

type Config struct {
	Mysql    Mysql
	Redis    Redis
	RabbitMq RabbitMq
}

type Mysql struct {
	Addr     string
	User     string
	Password string
	Database string
}
type Redis struct {
	Addr     string
	Password string
	Expire   int
}
type RabbitMq struct {
	Addr     string
	User     string
	Password string
	Database string
	Quire    string
}

var Conf Config

func ReadConfig() {
	viper.SetConfigFile("./config/conf.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&Conf)
	fmt.Println("conf:", Conf)
}
